#!/bin/bash

string_1='                  '
string_2='---------------------------'
green='\e[32m'
red='\e[31m'
defult='\e[39m'
bold='\e[1m'

echo -e "\n\n$bold $red $string_2 Hardware Infomation Of This Computer $string_2\n\n"

cpu_model=`cat /proc/cpuinfo | grep "model name" | head -n 1`
cpu_mhz=`cat /proc/cpuinfo | grep "cpu MHz" | head -n 1`
echo -e "\n$green cpu infomation:\n$defult $string_1 $cpu_model \n$string_1  $cpu_mhz\n"

memtotal=`cat /proc/meminfo | grep "MemTotal"`
memfree=`cat /proc/meminfo | grep "MemFree"`
memavailable=`cat /proc/meminfo | grep "MemAvailable"`
echo -e "\n$green mmemory infomation:\n$defult $string_1 $memtotal\n$string_1  $memfree\n$string_1  $memavailable"

disk_title=`df -h / | grep "Filesystem"`
disk_info=`df -h / | grep "/dev"`
echo -e "\n$green disk infomation:\n$defult $string_1 $disk_title\n $string_1 $disk_info"

network=`ifconfig ens33 | grep "inet "`
echo -e "\e$green network infomation:\n$defult            $network"


